package cn.kevinkun.CompCreator.helpers;

import java.util.HashMap;
import java.util.Map;

import com.google.appinventor.components.common.OptionList;

public enum VisibleComponent implements OptionList<String> {
	HorizontalArrangement("HorizontalArrangement"), HorizontalScrollArrangement("HorizontalScrollArrangement"),
	TableArrangement("TableArrangement"), VerticalArrangement("VerticalArrangement"),
	VerticalScrollArrangement("VerticalScrollArrangement"), Button("Button"), CheckBox("CheckBox"),
	ContactPicker("ContactPicker"), DatePicker("DatePicker"), EmailPicker("EmailPicker"), Image("Image"),
	ImagePicker("ImagePicker"), Label("Label"), ListPicker("ListPicker"), ListView("ListView"),
	PasswordTextBox("PasswordTextBox"), PhoneNumberPicker("PhoneNumberPicker"), Slider("Slider"), Spinner("Spinner"),
	Switch("Switch"), TextBox("TextBox"), TimePicker("TimePicker"), VideoPlayer("VideoPlayer"), WebViewer("WebViewer"),
	Ball("Ball"), Canvas("Canvas"), ImageSprite("ImageSprite");

	private String comp;
	private static final Map<String, VisibleComponent> lookup;

	private VisibleComponent(String comp) {
		this.comp = comp;
	}

	public String toUnderlyingValue() {
		return this.comp;
	}

	static {
		lookup = new HashMap();
		for (VisibleComponent comp : values()) {
			lookup.put(comp.toUnderlyingValue(), comp);
		}
	}

	public static VisibleComponent fromUnderlyingValue(String comp) {
		return (VisibleComponent) lookup.get(comp);
	}
}
